<!doctype html>
<html><!-- InstanceBegin template="/Templates/dwt.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta charset="utf-8">
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>谋刻职业教育在线测评与学习平台</title>
    <link rel="stylesheet" href="css/course.css"/>
    <script src="js/jquery-1.8.0.min.js"></script>
    <link rel="stylesheet" href="css/tab.css" media="screen">
    <script src="js/jquery.tabs.js"></script>
    <script src="js/mine.js"></script>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->

</head>

<body>

<div class="head" id="fixed">
    <div class="nav">
        <span class="navimg"><a href="index.html"><img border="0" src="images/logo.png"></a></span>
        <ul class="nag">
            <li><a href="courselist.html" class="link1 current">课程</a></li>
            <li><a href="articlelist.html" class="link1">资讯</a></li>
            <li><a href="teacherList.html" class="link1">讲师</a></li>
            <li><a href="exam_index.html" class="link1" target="_blank">题库</a></li>
            <li><a href="askarea.html" class="link1" target="_blank">问答</a></li>

        </ul>
        <span class="massage">
			<!--未登录-->
        	<span class="exambtn_lore">
                 <a class="tkbtn tklog" href="login.html">登录</a>
                 <a class="tkbtn tkreg" href="register.html">注册</a>
            </span>

        </span>
    </div>
</div>
<!-- InstanceBeginEditable name="EditRegion1" -->
<div id="app" class="coursecont" style="background: none repeat scroll 0 0 #fff;border-radius: 3px;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);" >
    <h3 class="righttit" style="padding-left:50px;">生成订单</h3>
    <div class="coursepic tecti" style="height: 20px">
        <h4>课程名称</h4>
        <p>{{course.courseName}}</p>
    </div>
    <div class="coursepic tecti" style="height: 20px">
        <h4>课程价钱</h4>
        <p>{{course.price}}元</p>
    </div>
    <div class="coursepic tecti" style="height: 20px">
        <h4>总课时</h4>
        <p>{{course.lessionNum}}</p>
    </div>
    <div class="coursepic tecti" style="height: 20px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-button type="info" @click="delOrder()">返回</el-button>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<el-button type="info" @click="buy()">购买</el-button>
    </div>

</div>
<!-- InstanceEndEditable -->


<div class="clearh"></div>
<div class="foot">
    <div class="fcontainer">
        <div class="fwxwb">
            <div class="fwxwb_1">
                <span>关注微信</span><img width="95" alt="" src="images/num.png">
            </div>
            <div>
                <span>关注微博</span><img width="95" alt="" src="images/wb.png">
            </div>
        </div>
        <div class="fmenu">
            <p><a href="#">关于我们</a> | <a href="#">联系我们</a> | <a href="#">优秀讲师</a> | <a href="#">帮助中心</a> | <a href="#">意见反馈</a> | <a href="#">加入我们</a></p>
        </div>
        <div class="copyright">
            <div><a href="/">谋刻网</a>所有&nbsp;晋ICP备12006957号-9</div>
        </div>
    </div>
</div>
<!--右侧浮动-->
<div class="rmbar">
	<span class="barico qq" style="position:relative">
	<div  class="showqq">
	   <p>官方客服QQ:<br>335049335</p>
	</div>
	</span>
    <span class="barico em" style="position:relative">
	  <img src="images/num.png" width="75" class="showem">
	</span>
    <span class="barico wb" style="position:relative">
	  <img src="images/wb.png" width="75" class="showwb">
	</span>
    <span class="barico top" id="top">置顶</span>
</div>
</body>

<!-- InstanceEnd --></html>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/moment.js"></script>
<!--引入 element-ui 的样式，-->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 必须先引入vue，  后使用element-ui -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
<!-- 引入element 的组件库-->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<script>
    new Vue({
        el:"#app",
        data:{
            course:{},
            user:{}
        },
        methods:{
            delOrder:function(){//返回，删除生成的订单
                window.location.href="coursecont1.html"
            },
            searchCoures:function(){//根据id查询课程详情信息
                var url = window.location.search;
                var id = url.split("=")[1];
                debugger
                axios.get("api/education-course/base/findCourse/"+id).then(
                    (res)=>{
                        debugger
                        if(res.data.success){
                            this.course=res.data.result;
                        }else{
                            this.$message({
                                showClose: true,
                                message: res.data.message,
                                type: 'error'
                            });
                        }
                    }
                );
            },
            buy:function () {//根据id查询订单详情信息
                axios.post("api/education-order/eduOrder/addOrder",this.course).then(
                    (res)=>{
                        debugger
                        if(res.data.success){
                            this.$message({
                                showClose: true,
                                message: res.data.message,
                                type: 'success'
                            });
                            window.location.href="order.html";
                        }else{
                            this.$message({
                                showClose: true,
                                message: res.data.message,
                                type: 'error'
                            });
                        }
                    }
                );
            }
        },
        mounted(){
            //this.user=JSON.parse(sessionStorage.getItem("user"));
            this.searchCoures();

        }
    });

</script>
<!-- InstanceEnd --></html>
